{% extends "base/appView.html" %}

{% block main %}

  {% if images %}
    <ul>
      {% for image in images %}
        <li><a href="{{ image.imageFile.url }}">{{ image.imageFile.name }}</a></li>

      {% endfor %}
    </ul>
  {% else %}
    <p>Keine Bilder vorhanden.</p>
  {% endif %}

  <!-- Upload form. Note enctype attribute! -->
  <form action="{% url upload %}" method="post" enctype="multipart/form-data">
    {% csrf_token %}
    <p>{{ form.non_field_errors }}</p>

    <p>{{ form.imageFile.label_tag }} {{ form.imageFile.help_text }}</p>

    <p>
      {{ form.imageFile.errors }}
      {{ form.imageFile }}
    </p>

    <p><input type="submit" value="Upload"/></p>
  </form>

{% endblock main %}
